package com.gxa.p2p.util;

import com.gxa.p2p.businessExceptionCode.ErrorCode;
import com.gxa.p2p.exception.BusinessException;
import com.gxa.p2p.service.VerifyCodeService;
import com.gxa.p2p.service.impl.VerifyCodeServiceImpl;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

public class CodeUtil {
    //VerifyCodeServiceImpl verifyCodeService=new VerifyCodeServiceImpl();
    public Map<String, Object> compare(String mapcode, String code){
        System.out.println(mapcode);
//      int code1=(int)request.getSession().getAttribute("code1");
        System.out.println("ssssssssssss "+code);
        MapUtil mapUtil=new MapUtil();
        if((mapcode).equals(code)){
            System.out.println(mapcode);
            mapUtil.put("code", 0);
            mapUtil.put("msg", "验证正确可以继续操作");
        }else{
            throw new BusinessException(ErrorCode.FAILED);
        }



        return mapUtil.getMap();
    }
}
